package org.x.casemodule.enums;

public enum RoleEnum {

    //'ATTENDEE','ORGANIZER'

    ATTENDEE("ATTENDEE", "参与人"),
    ORGANIZER("ORGANIZER", "组织者");
    private String code;
    private String name;
    RoleEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }



    public static RoleEnum getByCode(String code) {
        for (RoleEnum roleEnum : RoleEnum.values()) {
            if (roleEnum.code.equals(code)) {
                return roleEnum;
            }
        }
        return null;
    }


    public static RoleEnum getByName(String name) {
        for (RoleEnum roleEnum : RoleEnum.values()) {
            if (roleEnum.name.equals(name)) {
                return roleEnum;
            }
        }
        return null;
    }


}
